
  <div class="x_panel">
    <div class="x_content row">
      <div class="col-xs-12">
        <form class="form-horizontal form-label-left" action="{$actionUrl}" method="post" enctype="multipart/form-data">
          <div class="form-group">
            <label class="control-label col-md-2 col-sm-4 col-xs-12">门店名称：</label>
            <div class="checkbox col-md-10 col-sm-8 col-xs-12">
              <input class="form-control col-md-3 col-xs-12" type="text" name="form[store_name]" value="{$store.store_name}">
            </div>

            <label class="control-label col-md-2 col-sm-4 col-xs-12">所属行业：</label>
            <div class="checkbox col-md-10 col-sm-8 col-xs-12">
              <input class="form-control col-md-3 col-xs-12" type="text" name="form[industry]" value="{$store.industry}">
            </div>

            <label class="control-label col-md-2 col-sm-4 col-xs-12">门店省市区：</label>
            <div class="col-md-10 col-sm-12 com-xs-12">

              <select class="form-control-area" name="form[province]" id="zone1">
                {foreach $province AS $key => $value}
                <option value="{$value.region_code}" {if $value.region_code==$store.province}selected{/if}>{$value.region_name}</option>
                {/foreach}
              </select>

              <select class="form-control-area" name="form[city]" id="zone2">
                {foreach $city AS $key => $value}
                <option value="{$value.region_code}" {if $value.region_code==$store.city}selected{/if}>{$value.region_name}</option>
                {/foreach}
              </select>

              <select class="form-control-area" name="form[district]" id="zone3">
                {foreach $district AS $key => $value}
                <option value="{$value.region_code}" {if $value.region_code==$store.district}selected{/if}>{$value.region_name}</option>
                {/foreach}
              </select>

            </div>

            <label class="control-label col-md-2 col-sm-4 col-xs-12">地址：</label>
            <div class="checkbox col-md-10 col-sm-8 col-xs-12">
              <input class="form-control col-md-3 col-xs-12" type="text" name="form[address]" value="{$store.address}">
            </div>

            <label class="control-label col-md-2 col-sm-4 col-xs-12">经度：</label>
            <div class="checkbox col-md-10 col-sm-8 col-xs-12">
              <input class="form-control col-md-3 col-xs-12" type="text" name="form[longitude]" value="{$store.longitude}">
            </div>
            <label class="control-label col-md-2 col-sm-4 col-xs-12">纬度：</label>
            <div class="checkbox col-md-10 col-sm-8 col-xs-12">
              <input class="form-control col-md-3 col-xs-12" type="text" name="form[latitude]" value="{$store.latitude}">
            </div>

          </div>
          <div class="col-md-3 col-sm-12 col-xs-12 col-md-offset-4 col-sm-offset-4">
            <input name="store_id" type="hidden" value="{$store.store_id}">
            <button class="btn btn-primary" type="submit">更新</button>
          </div>
        </form>
      </div>
    </div>
  </div>
<script>
    $('#zone1').change(function (e) {
        var zoneid = this.value;
        var url = "{['area/getzone']|U}";
        $.post(url, 'zoneid='+zoneid, function (data) {
            $('#zone2').html('');
            for(var i=0; i<data.length; i++){
                $('#zone2').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
            }
            $.post(url, 'zoneid='+data[0].region_code, function (data1) {
                $('#zone3').html('');
                for(var i=0; i<data1.length; i++){
                    $('#zone3').append("<option value= '"+data1[i].region_code+"'>"+data1[i].region_name+"</option>");
                }
                $.post(url, 'zoneid='+data1[0].region_code, function (data2) {
                    $('#zone4').html('');
                    for(var i=0; i<data2.length; i++){
                        $('#zone4').append("<option value= '"+data2[i].region_code+"'>"+data2[i].region_name+"</option>");
                    }
                },'json');
            },'json');

        },'json');
    })
    $('#zone2').change(function (e) {
        var zoneid = this.value;
        var url = "{['area/getzone']|U}";
        $.post(url, 'zoneid='+zoneid, function (data) {
            $('#zone3').html('');
            for(var i=0; i<data.length; i++){
                $('#zone3').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
            }
            $.post(url, 'zoneid='+data[0].region_code, function (data1) {
                $('#zone4').html('');
                for(var i=0; i<data1.length; i++){
                    $('#zone4').append("<option value= '"+data1[i].region_code+"'>"+data1[i].region_name+"</option>");
                }
            },'json');
        },'json');
    })
  </script>